﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;

namespace ECONTACT.DataLayer
{
    public class TaiKhoanData
    {
        DataService m_TaiKhoanData = new DataService();

        public DataTable LayDsTaiKhoan()
        {
            SqlCommand cmd = new SqlCommand("SELECT * FROM TAIKHOAN");
            m_TaiKhoanData.Load(cmd);
            return m_TaiKhoanData;
        }

        // de dang nhap
        public DataTable LayDsTaiKhoan(String MaTK)
        {
            SqlCommand cmd = new SqlCommand("SELECT * FROM TAIKHOAN WHERE MaTK = @MaTK");
            cmd.Parameters.Add("MaTK", SqlDbType.Int).Value = Convert.ToInt32(MaTK);
            m_TaiKhoanData.Load(cmd);
            return m_TaiKhoanData;
        }

        public DataTable LayTTTaiKhoan(String MaTK)
        {
            DataService m_DData = new DataService();
            SqlCommand cmd = new SqlCommand("sp_XemThongTinTaiKhoan");

            cmd.Parameters.Add("@MATAIKHOAN", SqlDbType.Int).Value = Convert.ToInt32(MaTK);

            m_DData.LoadProc(cmd);
            return m_DData;
        }
    }
}
